package com.student.service;

import java.util.ArrayList;

import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.common.model.Project;
import com.common.model.StudentUser;
import com.common.model.TeacherUser;
import com.common.model.TimePlan;
import com.student.dao.StudentDao;
import com.student.model.IntentProject;
import com.teacher.model.ProjAndProf;

public class StudentService {
	
	private Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass());

	@Autowired
	private StudentDao sd;
	
	//学生个人信息维护
	public StudentUser studentInfo(Integer id)
	{
		return sd.studentInfo(id);
	}
	public boolean updateInfo(Integer id,String telephone,String qq)
	{
		return sd.updateInfo(id, telephone, qq);
	}
	public boolean updatePassword(Integer id,String password)
	{
		return sd.updatePassword(id, password);
	}
	
	//查询学院时间计划
	public TimePlan getTimePlan (Integer collegeId)
	{
		return sd.getTimePlan(collegeId);
	}
	
	//题目查询
	public ArrayList<TeacherUser> getTeachers(Integer depart_id)
	{
		return sd.getTeachers(depart_id);
	}
	public ArrayList<Project> getProjects(Integer prof_id,int page)
	{
		return sd.getProjects(prof_id,(page-1)*10,page*10);
	}
	public ArrayList<Project> getProjectsByTeacher(Integer tea_id,int page)
	{
		return sd.getProjectsByTeacher(tea_id,(page-1)*10,page*10);
	}
	
	//意向题目操作
	public ArrayList<IntentProject> getIntentProjects(Integer stu_id)
	{
		return sd.getIntentProjects(stu_id);
	}
    public boolean addIntentProject(int level,Integer pro_id,Integer stu_id,String message)
    {
    	return sd.addIntentProject(level, pro_id, stu_id, message);
    }
    public boolean updateMessage(Integer id,String message)
    {
    	return sd.updateMessage(id, message);
    }
    public boolean updateIntent(Integer id,int level)
    {
    	return sd.updateIntent(id, level);
    }
    public boolean removeIntent(Integer id) 
    {
    	return sd.removeIntent(id);
    }
    public Project getFinalProject(Integer stu_id)
    {
    	return sd.getFinalProject(stu_id);
    }
    
    //论文提交
    public boolean updateCommitmentsPath(String path,Integer stu_id)
    {
    	return sd.updateCommitmentsPath(path, stu_id);
    }
    public boolean updateEssayPath(String path,Integer stu_id)
    {
    	return sd.updateEssayPath(path, stu_id);
    }
}
